package com.songcha.library_base.mvvm.edit

import android.widget.ImageView
import androidx.databinding.ViewDataBinding
import com.songcha.library_base.bean.BaseEditBean
import com.songcha.library_base.mvvm.base.BaseMvvmActivity
import com.songcha.library_base.mvvm.base.BaseRepository
import com.songcha.library_base.mvvm.base.BaseViewModel
import com.songcha.library_common.helper.ViewHelper

abstract class BaseEditMvvmActivity<VM: BaseEditViewModel<out BaseRepository,out BaseEditBean>,DB: ViewDataBinding>:BaseMvvmActivity<VM,DB>(),IEditMvvmListener {
    override fun initObserver() {
        viewModel.editList.observe(this){data ->
            if(data != null)
                onEditListChange(data!! as MutableList<BaseEditBean>)
        }

        viewModel.isManage.observe(this){data ->
            onIsManageChange(data)
        }

        viewModel.isSelectAll.observe(this){data->
            onIsSelectAllChange(data)
        }

        viewModel.hasSelect.observe(this){data->
            onHasSelectChange(data)
        }
    }
}